import Vue from "vue";
// markdown 编写组件
import VueMarkdownEditor from "@kangc/v-md-editor";
import "@kangc/v-md-editor/lib/style/base-editor.css";
import vuepressTheme from "@kangc/v-md-editor/lib/theme/vuepress.js";
import "@kangc/v-md-editor/lib/theme/style/vuepress.css";

import Prism from "prismjs";
// 渲染markdown
import VMdPreviewHtml from "@kangc/v-md-editor/lib/preview-html";
import "@kangc/v-md-editor/lib/style/preview-html.css";

// 代码行号
import createLineNumbertPlugin from "@kangc/v-md-editor/lib/plugins/line-number/index";

// 复制代码
import createCopyCodePlugin from '@kangc/v-md-editor/lib/plugins/copy-code/index';
import createCopyCodePreview from "@kangc/v-md-editor/lib/plugins/copy-code/preview";
import "@kangc/v-md-editor/lib/plugins/copy-code/copy-code.css";

// 创建组件
VueMarkdownEditor.use(vuepressTheme, {
  Prism,
});

VueMarkdownEditor.use(createCopyCodePlugin());
// VueMarkdownEditor.use(createLineNumbertPlugin());
VMdPreviewHtml.use(createCopyCodePreview());
Vue.use(VueMarkdownEditor);
Vue.use(VMdPreviewHtml);